import Koa from 'koa'
import router from './routes'

// 实例化Koa
const app: Koa = new Koa()

app.use(async (ctx: Koa.DefaultContext, next: Koa.Next) => {
  next()
})

// 启用路由
app.use(router.routes())
app.use(router.allowedMethods())

app.listen(3002, () => {
  console.log('server is running at port 3000')
})